package com.yvan.periscope.alert;

import com.yvan.elasticjob.ElasticJobService;
import com.yvan.elasticjob.Job;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2018/8/22.
 */
@Slf4j
@Component
public class Coordinator {

//    @Autowired
//    private ElasticJobService elasticJobService;

    //TODO main flow
    public void add(){
//        Job cronJob = new Job();
//        cronJob.setJobType("SIMPLE");
//        cronJob.setCron("*/5 * * * * ?");
//        cronJob.setJobParameter("1");
//        cronJob.setJobName("test");
//        cronJob.setJobClass(CronJob.class.getName());
//        elasticJobService.addJob(cronJob);
    }

    //TODO main flow
    public void remove() {
//        try {
//            elasticJobService.removeJob("test");
//        }
//        catch (Exception ex){
//            log.error("job remove error",ex);
//        }
    }
}
